package com.demo.jdbc.c_dbcp;

import com.demo.jdbc.a_domain.User;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestDBCP {
    
    @Test
    public void demo1(){
    
        User user=new User();
        user.setId(1);
        user.setUsername("张三三");
        user.setPassword("998");
        String xmlPath = "com/demo/jdbc/c_dbcp/beans.xml";
        ApplicationContext applicationContext=new ClassPathXmlApplicationContext(xmlPath);
        UserDao userDao = (UserDao) applicationContext.getBean("userDaoId");
        userDao.update(user);
    
    }
}
